Title: SQL W3S (By-BKK) / 012 Update
Tags: Obsidian_to_Anki

Q: What does the SQL UPDATE statement do?
A: Modifies existing records in a table

Q: True/False: The WHERE clause is optional in UPDATE statements
A: True, but without WHERE, all records are updated

Q: How do you update one column in one row in SQL?
A: UPDATE table_name SET column1 = value1 WHERE condition

Q: Show an example updating contact name and city for one customer
A: UPDATE Customers SET ContactName='Alfred Schmidt', City='Frankfurt' WHERE CustomerID=1;

Q: How do you update multiple rows based on a condition?
A: Use UPDATE with WHERE matching the condition

Q: Show an example updating ContactName to 'Juan' for all customers in Mexico
A: UPDATE Customers SET ContactName='Juan' WHERE Country='Mexico';

Q: What happens if you omit the WHERE clause in UPDATE?
A: All rows in the table will be updated

Q: True/False: You can update more than one column in a single UPDATE statement
A: True

Q: Modifies existing records in a table
A: What does the SQL UPDATE statement do?

Q: UPDATE Customers SET ContactName='Juan' WHERE Country='Mexico';
A: Show an example updating ContactName to 'Juan' for all customers in Mexico

Q: True
A: Can you update multiple columns in one UPDATE statement?

Q: All rows in the table will be updated
A: What happens if you omit WHERE in UPDATE?